/*
 * Copyright 2016-2019 yoara
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package yhao.infra.feature.mysql;

import yhao.infra.service.datasource.BaseDaoConfigFactory;

/**
 * Mysql配置工厂
 *
 * @see BaseDaoConfigFactory
 * @author yoara
 */
public class ConfigFactory extends BaseDaoConfigFactory {
    //baseDao 的bean名
    public static final String BASE_DAO_BEAN_NAME = "mysqlBaseDao";
    //mysql服务器地址
    public static final String BASIC_MYSQL_URL = "basic.mysql.url";
    //用户名
    public static final String BASIC_MYSQL_USERNAME = "basic.mysql.username";
    //密码
    public static final String BASIC_MYSQL_PASSWORD = "basic.mysql.password";
    /***********以下非必填**********/
    //初始化线程池大小，默认10
    public static final String BASIC_MYSQL_DRUID_INITIAL_SIZE = "basic.mysql.druid.initialSize";
    //最小连接数，默认10
    public static final String BASIC_MYSQL_DRUID_MIN_IDLE = "basic.mysql.druid.minIdle";
    //最大连接数，默认200
    public static final String BASIC_MYSQL_DRUID_MAX_ACTIVE = "basic.mysql.druid.maxActive";
    //获取连接时最大等待时间，单位毫秒，默认30000
    public static final String BASIC_MYSQL_DRUID_MAX_WAIT = "basic.mysql.druid.maxWait";
    //执行validationQuery检测连接是否有效，默认300000
    public static final String BASIC_MYSQL_DRUID_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "basic.mysql.druid.timeBetweenEvictionRunsMillis";
    //Destroy线程中如果检测到当前连接的最后活跃时间和当前时间的差值大于，则关闭连接。默认60000
    public static final String BASIC_MYSQL_DRUID_MIN_EVICTABLE_IDLE_TIME_MILLIS = "basic.mysql.druid.minEvictableIdleTimeMillis";
    //统计拦截器容量，默认3000
    public static final String BASIC_MYSQL_DRUID_STAT_SQL_MAX_SIZE = "basic.mysql.druid.stat.sql.MaxSize";
}
